package com.css.zfzx.sjcj.modules.hddcA1InvRgnHasMaterialTable.repository;

import com.css.zfzx.sjcj.modules.hddcA1InvRgnHasMaterialTable.repository.entity.HddcA1InvrgnhasmaterialtableEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * @author zyb
 * @date 2020-11-30
 */
public interface HddcA1InvrgnhasmaterialtableRepository extends JpaRepository<HddcA1InvrgnhasmaterialtableEntity, String> {


    @Query(nativeQuery = true, value = "select * from hddc_a1_invrgnhasmaterialtable where is_valid !=0 and project_name in :projectIds")
    List<HddcA1InvrgnhasmaterialtableEntity> queryHddcA1InvrgnhasmaterialtablesByProjectId(@Param("projectIds") List<String> projectIds);

    @Query(nativeQuery = true, value = "select * from hddc_a1_invrgnhasmaterialtable where is_valid !=0 and task_name in :taskIds")
    List<HddcA1InvrgnhasmaterialtableEntity> queryHddcA1InvrgnhasmaterialtablesByTaskId(@Param("taskIds") List<String> taskIds);


}
